package com.redmoon.weixin.mgr;

import cn.js.fan.util.ErrMsgException;
import cn.js.fan.util.StrUtil;
import cn.js.fan.web.Global;
import com.cloudweb.oa.api.IWorkWeixinService;
import com.cloudweb.oa.utils.SpringUtil;
import com.cloudwebsoft.framework.util.LogUtil;
import com.redmoon.kit.util.FileInfo;
import com.redmoon.kit.util.FileUpload;
import com.redmoon.oa.sys.DebugUtil;
import com.redmoon.weixin.Config;
import com.redmoon.weixin.util.HttpPostFileUtil;
import com.redmoon.weixin.util.HttpUtil;
import org.json.JSONException;
import org.json.JSONObject;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Vector;

/**
 * Created by fgf on 2018/12/15.
 */
public class AgentMgr {
    public static String setAgent(ServletContext application, HttpServletRequest request) throws ErrMsgException {
        IWorkWeixinService workWeixinService = SpringUtil.getBean(IWorkWeixinService.class);
        return workWeixinService.setAgent(application, request);
    }

    public static String uploadMedia(String secret, String filePath) {
        IWorkWeixinService workWeixinService = SpringUtil.getBean(IWorkWeixinService.class);
        return workWeixinService.uploadMedia(secret, filePath);
    }
}
